package de.gwtprime.client;

import java.util.List;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

import de.gwtprime.shared.MyVideoEntry;
import de.gwtprime.shared.Stock;
import de.gwtprime.shared.UserDTO;

/**
 * The client side stub for the RPC service.
 */
@RemoteServiceRelativePath("greet")
public interface PrimeService extends RemoteService {
	
	String testRPCConnection() throws Exception;
	
	List<Stock> greetServer(String name) throws IllegalArgumentException, Exception;
	
	Stock loadTradingSignals(String name) throws IllegalArgumentException, Exception;
	
	UserDTO isLoggedIn();
	
	UserDTO login(String userName, String password) throws Exception;

	void logout();
	
	public void sendMail(String name, String email, String message);
	
	
	public List<MyVideoEntry> getVideos(int number);
	
	public void addSubstriber(String eMail) throws Exception;

	public String retrieveNewAddress() throws Exception;
	
	public Boolean sendCoins(String toAddress, Double amount) throws Exception;
	
	/**
	 * Retrieve a channel token for the given user id
	 * @param userId ID of the user that need a channel token
	 * @return A channel token. Client can listen with a channel on this token
	 * for new messages from sever.
	 * @throws Exception
	 */
	public String getChannelToken(Long userId) throws Exception;
}
